package com.huangye88.etl;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DataRowUtil {

    public static DataRow createInstance(ResultSet rs) throws SQLException {
        int count = rs.getMetaData().getColumnCount();
        DataRow row = new DataRow();
        for (int i = 0; i < count; i++) {
            String colname = rs.getMetaData().getColumnName(i + 1);

            row.put(colname.toUpperCase(), rs.getObject(i + 1));
        }
        return row;
    }
}